#!/bin/bash

###############################
## configuration open-box    ##
###############################


#############################
## Supprimer le clic droit ##
#############################

echo -e "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<openbox_menu xmlns=\"http://openbox.org/\"\n\t xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\txsi:shemaLocation=\"http://openbox.org/ file:///usr/share/openbox/menu.xsd\">\n</openbox_menu>" > /etc/xdg/openbox/menu.xml

##########################################
## Rox-filer au demarrage de la session ##
##########################################

echo -e "#Runing the filer\nrox-filer --dir=~/.rdp_shortcuts/ --user &" >> /etc/xdg/openbox/autostart.sh

#############################
## configuration apache    ##
#############################

### Config de Apache2 pour q'il execute les cgi###
##################################################

echo -e "<VirtualHost *:80>\n\tServerAdmin webmaster@localhost\n\tDocumentRoot /var/www\n\t<Directory />\n\t\tOptions FollowSymLinks\n\t\tAllowOverride None\n\t</Directory>\n\t<Directory /var/www/>\n\t\tOptions Indexes FollowSymLinks MultiViews\n\t\tAllowOverride None\n\t\tOrder allow,deny\n\t\tallow from all\n\t\t</Directory>\n\tScriptAlias /cgi-bin/ /var/www/OAB/\n\t<Directory "/var/www/OAB">AllowOverride None\n\t\tOptions +ExecCGI -MultiViews +SymLinksIfOwnerMatch\n\t\tOrder allow,deny\n\t\tAllow from all\n\t\tAddHandler cgi-script .cgi .py\n\t</Directory>\n\tErrorLog ${APACHE_LOG_DIR}/error.log\n\t# Possible values include: debug, info, notice, warn, error, crit,\n\t# alert, emerg.\n\tLogLevel warn\n\tCustomLog ${APACHE_LOG_DIR}/access.log combined\n</VirtualHost>" > /etc/apache2/sites-available/default

chmod -R 777 /var/www/oab
a2dissite 000-default
a2ensite oab-web
/etc/init.d/apache2 reload

#############################
## configuration xrdp      ##
#############################

cp /usr/share/oab/ad24b.bmp /usr/share/xrdp/ad24b.bmp
cp /usr/share/oab/ad256.bmp /usr/share/xrdp/ad256.bmp
cp /usr/share/oab/xrdp256.bmp /usr/share/xrdp/xrdp256.bmp
cp /usr/share/oab/xrdp24b.bmp /usr/share/xrdp/xrdp24b.bmp

